﻿<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" th:href="@{/adminlte/bower_components/bootstrap/dist/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" th:href="@{/adminlte/bower_components/font-awesome/css/font-awesome.min.css}">
    <!-- Ionicons -->
    <link rel="stylesheet" th:href="@{/adminlte/bower_components/Ionicons/css/ionicons.min.css}">
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{/adminlte/dist/css/AdminLTE.min.css}">
    <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
          page. However, you can choose any other skin. Make sure you
          apply the skin class to the body tag so the changes take effect. -->
    <link rel="stylesheet" th:href="@{/adminlte/dist/css/skins/skin-blue.min.css}">
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">

    <title>标椎地名地址管理系统</title>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <div th:replace="common/user_header :: user_header"></div>

    <div th:replace="common/user_menu :: user_menu"></div>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper" >
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                Page Header
                <small>Optional description</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i></a>首页</li>
                <li class="active">登陆成功</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content container-fluid">

            <!--------------------------
              | Your Page Content Here |
              -------------------------->
            <div class="row">

                <div class="col-md-2  "></div>
                <div class="col-md-7">
                    <form class="layui-form" action="/Suggest/add" method="post">
                        <div class="layui-form-item">
                            <div class="layui-input-block" style="text-align: center;font-size: 20px">
                                <span>Suggestion For Us!</span>
                            </div>
                        </div>

                        <div class="layui-form-item layui-form-text">
                            <div class="layui-input-block">
                                <textarea name="content" placeholder="您的建议..." style="min-height: 150px" class="layui-textarea"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block" style="text-align: center">
                                <button class="layui-btn" lay-submit lay-filter="formDemo" style="margin-right: 100px">提交</button>
                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="col-md-3  "></div>

            </div>

        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

    <div th:replace="common/footer :: footer"></div>



</div>
<!-- ./wrapper -->

<!-- REQUIRED JS SCRIPTS -->

<!-- jQuery 3 -->
<script th:src="@{/adminlte/bower_components/jquery/dist/jquery.min.js}"></script>
<!-- Bootstrap 3.3.7 -->
<script th:src="@{/adminlte/bower_components/bootstrap/dist/js/bootstrap.min.js}"></script>
<!-- AdminLTE App -->
<script th:src="@{/adminlte/dist/js/adminlte.min.js}"></script>
<script th:src="@{/layui/layui.js}"></script>

<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;
        //监听提交
        form.on('submit(formDemo)', function(data){
            console.log("用户建议提交data---"+data)
            var url="/Suggest/add";
            $.post(url,data.field,function(dataR){
                var result;
                if(typeof dataR=='object'){
                    result=dataR;
                }else{
                    result=JSON.parse(dataR);
                }
                console.log("用户建议提交result---"+result)
                if(result.code=="0000"){
                    layer.msg(result.msg, {
                        icon: 1,
                        time: 3000 //2秒关闭（如果不配置，默认是3秒）
                    }, function(){
                        location.reload();
                    });
                }else{
                    layer.msg("提交失败！");
                }
            });
            return false;
        });
    });
</script>



</body>
</html>

